﻿// -----------------------------------------------------------------------
// <copyright file="VideoMask.cs" company="Abyssalsoft">
// TODO: Update copyright text.
// </copyright>
// -----------------------------------------------------------------------

namespace Core.Player.Masks
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;

    /// <summary>
    /// Video mask
    /// </summary>
    public partial class VideoMask : UserControl
    {
        /// <summary>
        /// Initializes a new instance of the VideoMask class.
        /// </summary>
        public VideoMask()
        {
            this.InitializeComponent();
            //this.SetStyle(ControlStyles.OptimizedDoubleBuffer, false);
            this.Disposed += new EventHandler(this.OnDispose);
            Video.Render.Instance.SetOutputFrame(ref this.VideoFrame);
            this.Dock = DockStyle.Fill;
        }

        /// <summary>
        /// Release used objects
        /// </summary>
        /// <param name="sender">Object sender</param>
        /// <param name="e">Event args</param>
        private void OnDispose(object sender, EventArgs e)
        {
            Video.Render.Instance.ReleaseObjects(sender, e);
        }
    }
}
